Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAP_STACK fixes #2285

Merged
merged 4 commits into from
Jan 10, 2025
Merged

MAP_STACK fixes #2285

merged 4 commits into from
Jan 10, 2025

Conversation

brooksdavis
Copy link
Member

Fix the underlying issue in #2252 (failed vm_map_stack_lock due to write reservations) and then forbid the MAP_STACK within an existing reservation since it's not done anywhere and doesn't make much sense.

If we're trying to install a stack within a reservation (uncommon and
likely not sensible), we need to use the reservation's address not the
address of the bottom of the stack.

Fixes: #2252
Put backslashes in the 73nd column not 81st.
@brooksdavis brooksdavis requested a review from qwattash January 7, 2025 19:45
bin/cheribsdtest/cheribsdtest.h Outdated Show resolved Hide resolved
Use typeof() to make CHERIBSDTEST_CHECK_CALL_ERROR compatible with
functions that return pointers (e.g., mmap()).

Print unexpected return values with %#p to support most integer values.
It doesn't make sense to insert a stack into a reservation so disallow
MAP_FIXED|MAP_STACK with a valid capability in addr.  It's still allowed
to MAP_FIXED|MAP_STACK, but only if there's nothing in that location
(and you shouldn't be doing that).
@brooksdavis brooksdavis added the ready-to-land PR is ready to land after revisions label Jan 9, 2025
@bsdjhb bsdjhb merged commit 8e5a606 into dev Jan 10, 2025
29 checks passed
@bsdjhb bsdjhb deleted the vm_map_stack-fixes branch January 10, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-land PR is ready to land after revisions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants